<template>
<div>
  <el-row>
    用户选择组件应用  &nbsp; <el-button @click="btnClick">选择部门</el-button>
  </el-row>
  <el-row>
      <span>使用说明：
      <ul>
        <li> multiple：是否多选 , 默认允许多选true  </li>
        <li> deptIds：回显默认选择的部门，类型为数组（子组件接受父组件传过来的参数并显示） </li>
        <li> getDeptList：返回用户选择的部门，（父组件接收子组件选择的部门，参数为数组）</li>
      </ul>
    </span>
  </el-row>
  <check-dept ref="checkDept" :multiple="true" :deptIds="deptIds" @returnDeptList="getDeptList"></check-dept>
</div>
</template>

<script>
import checkDept from '@/components/form/compound/selectDept'

export default {
  data() {
    return {
      deptIds:[87,91,92,152]
    }
  },
  components: {
    checkDept
  },
  methods:{
    getDeptList(deptList){
     //console.log(deptList)
    },
    btnClick(){
      this.$nextTick(() => {
        this.$refs.checkDept.init();
      });
    }
  }
}
</script>

<style scoped>

</style>
